package com.gitee.free.coding.core.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * Redis键的前缀，便于统一清理、分组查询
 */
@Getter
@AllArgsConstructor
public enum RedisKeyPrefixEnum {

    // TOKEN
    TOKEN("TOKEN:"),

    // 验证码
    VERIFICATION_CODE("VERIFICATION_CODE:"),
    ;

    private final String prefix;

    public static String getToken(String value) {
        return RedisKeyPrefixEnum.TOKEN.getPrefix() + value;
    }

    public static String getVerifyCode(String value) {
        return RedisKeyPrefixEnum.VERIFICATION_CODE.getPrefix() + value;
    }

}
